package com.aiti.lulian.converter;

import com.aiti.lulian.workflow.ProcessStatus;
import com.alibaba.excel.converters.Converter;
import com.alibaba.excel.enums.CellDataTypeEnum;
import com.alibaba.excel.metadata.GlobalConfiguration;
import com.alibaba.excel.metadata.data.ReadCellData;
import com.alibaba.excel.metadata.data.WriteCellData;
import com.alibaba.excel.metadata.property.ExcelContentProperty;

public class ProcessStatusConverter implements Converter<ProcessStatus> {

    @Override
    public Class<ProcessStatus> supportJavaTypeKey() {
        return ProcessStatus.class;
    }

    @Override
    public CellDataTypeEnum supportExcelTypeKey() {
        return CellDataTypeEnum.STRING;
    }




    @Override
    public WriteCellData<?> convertToExcelData(ProcessStatus value, ExcelContentProperty contentProperty, GlobalConfiguration globalConfig) {
        return new WriteCellData<>(value.getText());
    }
}
